package com.zhou.jiancai.activity;

import android.app.Activity;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.widget.Toast;

import com.andexert.calendarlistview.library.DayPickerView;
import com.andexert.calendarlistview.library.SimpleMonthAdapter;
import com.zhou.jiancai.R;

/**
 * Created by Administrator on 2017/5/23.
 */

public class CalendarActivity extends Activity implements com.andexert.calendarlistview.library.DatePickerController {

    private DayPickerView dayPickerView;
    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.calender_activity);
        //这里需要设置控制器
        dayPickerView= (DayPickerView) findViewById(R.id.clanderView);
        dayPickerView.setController(CalendarActivity.this);


    }

    @Override
    public int getMaxYear() {
        return 2000*10;
    }//应该够所有人活着的了  不要太大了如果太大会不显示数据原因未知


    @Override
    public void onDayOfMonthSelected(int year, int month, int day) {
        Toast.makeText(CalendarActivity.this, "您选择了"+year+"年"+month+"月"+day+"日", Toast.LENGTH_SHORT).show();
    }

    @Override
    public void onDateRangeSelected(SimpleMonthAdapter.SelectedDays<SimpleMonthAdapter.CalendarDay> selectedDays) {

    }
}
